{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "# 定义各个路径片段\n",
    "base_dir = \"/root/MyCode/Mogolian_TextRecognition/PHOCNet/phocnet-torch\"\n",
    "sub_dir = \"resources\"\n",
    "sub_sub_dir = \"data\"\n",
    "\n",
    "# 获取当前工作目录\n",
    "current_directory = os.getcwd()\n",
    "\n",
    "# 使用 os.path.join() 拼接路径\n",
    "full_path = os.path.join(base_dir, sub_dir, sub_sub_dir)\n",
    "\n",
    "# 打印结果\n",
    "print(\"Full path:\", full_path)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我想将一个路径加入os.path来可以搜索到我的package 我该怎么写呢"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "\n",
    "# 假设你的 package 路径是 \"/path/to/your/package\"\n",
    "your_package_path = \"/path/to/your/package\"\n",
    "\n",
    "# 将路径添加到 sys.path\n",
    "if your_package_path not in sys.path:\n",
    "    sys.path.append(your_package_path)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
